from select import select

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()  # 导包
driver.get('http://192.168.20.244/ecshop/admin/privilege.php?act=login')
driver.maximize_window()  # 最大化

# demo2

# driver.find_element(By.NAME, 'username').send_keys('caichang')  # By 要导包
# driver.find_element(By.NAME, 'password').send_keys('caichang1')
# driver.find_element(By.CLASS_NAME, 'btn-a').click()

# 优先级  Id，NAME，XPATH，LINK_TET   8个元素，其他不用
driver.find_element(By.XPATH,'//*[@id="loginPanel"]/div[1]/input').send_keys('caichang')
driver.find_element(By.XPATH,'//*[@id="loginPanel"]/div[2]/input').send_keys('caichang1')
driver.find_element(By.XPATH,'//*[@id="tijiao"]').click()

# driver.find_element(By.LINK_TEXT,'去店铺首页>>').click()


driver.switch_to.frame('menu-frame')  #进入内帧
driver.find_element(By.XPATH,'//*[@id="menu-ul"]/li[2]/ul/li[1]/a').click()
driver.switch_to.default_content()    #退出内帧

driver.switch_to.frame('main-frame')
driver.find_element(By.NAME,'keyword').send_keys('凤姐洗衣服2')
driver.find_element(By.XPATH,'/html/body/div[3]/form/input[2]').click()

driver.find_element(By.NAME,'suppliers_id').click()


# driver.switch_to.default_content()

select




